package com.hui.mapper;

import com.hui.entity.Recode;
import com.hui.vo.RecodeVo;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Description
 * @date 2023/2/11 11:58
 */
public class RecodeMapper implements RowMapper<Recode> {
    @Override
    public Recode rowToEntity(ResultSet rs) {
        Recode recode = null;

        try {
            int id = rs.getInt("id");
            int productId = rs.getInt("productId");
            int mgrId = rs.getInt("mgr_id");

            int num = rs.getInt("num");
            Date createTime = rs.getDate("createtime");

            recode = new Recode(id, productId, mgrId, createTime, num);

        } catch (SQLException e) {
            throw new RuntimeException(e);
        }

        return recode;
    }
}
